import * as actionType from './actionType.js'

export const addToCart = (cartItem) => {
  return {
    type: actionType.ADD_TO_CART,
    payload: {
      cartItem
    }
  }
}
export const cartCountAdd = (id) => {
  return {
    type: actionType.CART_COUNT_ADD,
    payload: {
      id
    } 
  }
}
export const cartCountReduce = (id) => {
  return {
    type: actionType.CART_COUNT_REDUCE,
    payload: {
      id
    }
  }
}
export const toggleChecked = (id) => {
  return {
    type: actionType.TOGGLE_CHECKED,
    payload: {
      id
    }
  }
}
export const cartCountDelete = (id) => {
  return {
    type: actionType.CART_ITEM_DELETE,
    payload: {
      id
    }
  }
}
export const toggleAllChecked = (status) => {
  console.log(status)
  return {
    type: actionType.TOGGLE_ALL_CHECKED,
    payload: {
      status
    }
  }
}